﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <link href="../styles/js-console.css" rel="stylesheet" />
</head>
<body>
    <div id="js-console"></div>
    <script src="../scripts/js-console.js"></script>
    <script>
        function reverseString(string) {
            var charArray = [];
            for (var i = string.length - 1; i >= 0; i--) {
                charArray.push(string[i]);
            }

            var reversedString = charArray.join("");

            return reversedString;
        }
        
        var str = "sample";
        jsConsole.writeLine(reverseString(str));
    </script>
</body>
</html>
